package zhr.chapter4;

public class Line {
    Point apoint;
    Point bpoint;
    double length;

    public Line(Point a, Point b) {
        this.apoint=a;
        this.bpoint=b;
    }
    void printLength(){
        length= Math.sqrt(Math.pow((apoint.x- bpoint.x),2)+Math.pow((apoint.y- bpoint.y),2));
        System.out.printf("两点之间的距离为:%.2f",length);
    }
}
